GNU Radio's CCSDS Package
reedsolomon.h
Go to the documentation of this file.
1 #ifndef REEDSOLOMON_H
2 #define REEDSOLOMON_H
3 #include <vector>
4 #include <algorithm>
5 #include <string>
6 #include "rs"
7 using namespace std;
9 {
10 public:
11  //Constructors
12  //reedSolomon();
13  reedSolomon(int rsType, int depth, int basis);
14 
15  //Encoder and decoder
16  void encodeRS223(std::vector<unsigned char> &data);
17  int decodeRS223(std::vector<unsigned char> &data);
18  void encodeRS239(std::vector<unsigned char> &data);
19  int decodeRS239(std::vector<unsigned char> &data);
20  void (reedSolomon::*encoder)(std::vector<unsigned char> &data);
21  int (reedSolomon::*decoder)(std::vector<unsigned char> &data);
22 
23  //Encoder and decoder wrappers
24  void encode(std::vector<unsigned char> &data);
25  int decode(std::vector<unsigned char> &data, int &wer);
26 
27  //Getters
28  int getRSType() const;
29  int getDepth() const;
30  bool getBasis() const;
31  string getRSName() const;
32  int getnRoots() const;
33 
34 protected:
35  //Setters
36  void setRSType(int rsType);
37  void setDepth(int depth);
38  void setBasis(int basis);
39 
40  //Basis and conventional converters
41  void basis2Conv(std::vector<unsigned char> &data);
42  void conv2Basis(std::vector<unsigned char> &data);
43 
44 private:
45  int d_rsType;
46  int d_depth;
47  bool d_basis;
48  string d_rsName;
49  int d_nRoots;
50  std::vector<int> errors;
51  ezpwd::RS_CCSDS<255,223> rs223;
52  ezpwd::RS_CCSDS<255,239> rs239;
53 
54 };
55 
56 #endif // REEDSOLOMON_H
Definition: reedsolomon.h:8
STL namespace.